package cn.iocoder.yudao.module.api.promotion.gift.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/03/18
 */
@Getter
@RequiredArgsConstructor
public enum GiftRecordStatus implements EnumValuable {
    INITIAL(0, "初始化"),
    PENDING(1, "待领取"),
    TAKEN(2, "已领取"),
    EXPIRED(3, "已过期"),
    TRANSFERRED(4, "已转赠");

    @EnumValue
    private final Integer value;
    private final String name;

    public static GiftRecordStatus valueOf(int value) {
        return Arrays.stream(values())
                .filter(method -> method.value == value)
                .findFirst()
                .orElse(PENDING);
    }

}
